<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// +----------------------------------------------------------------------
// | Loan [ NO ZUO NO DIE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2010-2017 http://www.bocweb.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: Hanj
// +----------------------------------------------------------------------
 
//----------------------------------
// Loan-三方托管交易类
//----------------------------------

class Loan {

	protected $valid_sdks 	= array('Loan_qdd', 'Loan_fuyou');
	protected $_adapter	    = 'qdd';
	public    $_obj         = null;

	// ------------------------------------------------------------------------

	/**
	 * Constructor
	 *
	 * @param array
	 */
	public function __construct($config = array())
	{
		$this->_initialize($config);
	}
	
	// ------------------------------------------------------------------------

	/**
	 * Initialize
	 *
	 * Initialize class properties based on the configuration array.
	 *
	 * @param	array
	 * @return 	void
	 */
	private function _initialize($config)
	{

		if (isset($config['loan']) and in_array('Loan_'.$config['loan'], $this->valid_sdks))
		{
			$this->_adapter = $config['loan'];
		} 

		include_once LIBS_PATH."libraries/netcredit/drivers/".$this->_adapter."/loan_main.php";
		$this->_obj = new loan_main();

	}

}